﻿
using System;
using System.Globalization;

namespace ToolUtil
{
    public class DateTool
    {
        public static string formatDate1= "yyyy/MM/dd";
        public static string formatDate2 = "yyyy-MM-dd";
        public static string formatDate3 = "yyyyMMdd";
        public static string formatDate4 = "yyyy/MM/dd HH:mm:ss.fff";

        public static DateTime stringToDate(string str,string frt)
        {
            DateTime dt = DateTime.ParseExact(str, frt, System.Globalization.CultureInfo.CurrentCulture);
            return dt;
        }
    }
}
